1. Field of the Invention
The present invention relates to an apparatus of encoding/decoding voice, and more specifically, to an apparatus for and method of selecting encoding/decoding appropriate to voice characteristics in a voice encoding/decoding apparatus.
2. Description of Related Art
A conventional linear prediction coding (LPC) coefficient quantizer obtains an LPC coefficient to perform linear prediction on signals input to a encoder of a voice compressor/decompressor (codec), and quantizes the LPC coefficient to transmit it to the decoder. However, there are problems in that an operating range of the LPC coefficient is too wide to be directly quantized by the LPC coefficient quantizer and a filter stability is not guaranteed even with small errors. Therefore, the LPC coefficient is quantized by converting into a line spectral frequency (LSF), which is mathematically equivalent with good quantization characteristics.
In general, in the case of narrow band speech codec that has 8 kHz input speech, 10 LSFs are made for representing spectral envelope. Here, the tenth-order LSF has a high correlation in a short term, and a ordering property among respective elements in the LSF vector, so that a predictive vector quantizer is used. However, when a frame in which frequency characteristics of the voice are rapidly changed, there occur a lot of errors due to a predictor so that the quantization performance is degraded. Accordingly, a quantizer having two predictors has been used to quantize the LSF vector having low inter-correlation correlation.
FIG. 1 is a diagram showing a typical arrangement of an LSF quantizer having two predictors.
An LSF vector input to an LSF quantizer is input to a first vector quantization unit 111 and a second vector quantization unit 121 through lines, respectively. Here, respective first and second subtractors 100 and 105 subtract LSF vectors predicted by respective first and second predictors 115 and 125 from the LSF vector respectively input to the first vector quantization unit 111 and the second vector quantization unit 121, respectively. A process of subtracting the LSF vector is shown in the following equation. 1.
                              r                      1            ,            n                    i                =                              (                                          f                n                i                            -                                                f                  ~                                                  1                  ,                                                                          ⁢                  n                                i                                      )                    /                      β            1            i                                              [                  Equation          ⁢                                          ⁢          1                ]            where, ri1,n is a prediction error of an ith element in an nth frame of the LSF vector of the first vector quantizer 110 fin is an ith element in the nth frame of LSF vector,
      f    ~        1    ,                  ⁢    n    iis an ith element in the nth frame of the predicted LSF vector of the first vector quantization unit 111, and βi1 is a prediction coefficient between ri1,n and fin of the first vector quantization unit 111.
The prediction error signal output through the first subtractor 100 is vector quantized by the first vector quantizer 110. The quantized prediction error signal is input to the first predictor 115 and a first adder 130. The quantized prediction error signal input to the first predictor 115 is calculated as shown in the following equation 2 to predict the next frame and then stored into a memory.
                                                                        f                ~                                            1                ,                                                                  ⁢                                  n                  +                  1                                            i                        =                                                            α                  1                  i                                ⁢                                                      r                    ^                                                        1                    ,                                                                                  ⁢                    n                                    i                                ⁢                                                                  ⁢                i                            =              1                                ,          …          ⁢                                          ,          10                ⁢                                                      [                  Equation          ⁢                                          ⁢          2                ]            wherein, {circumflex over (r)}1,ni is an ith element in an nth frame of the quantized prediction error signal of the first vector quantizer 110, and αi1 is an prediction coefficient of the ith element of the first vector quantization unit 111.
The first adder 130 adds the predicted signal to the LSF prediction error vector quantized by the first vector quantizer 110. The LSF prediction error vector added to the predicted signal is output to the LSF vector selection unit 140 via the line. The predicted signal adding process by the first adder 130 is performed as shown in Equation 3.
                                                        f              ^                                      1              ,                                                          ⁢              n                        i                    =                                                                      f                  ~                                                  1                  ,                                                                          ⁢                  n                                i                            +                                                β                  1                  i                                ⁢                                                      r                    ^                                                        1                    ,                                                                                  ⁢                    n                                    i                                ⁢                                                                  ⁢                i                                      =            1                          ,                  …          ⁢                                          ⁢          10                                    [                  Equation          ⁢                                          ⁢          3                ]            where, {circumflex over (r)}1,ni is an ith element in the nth frame of the quantized prediction error signal of the first vector quantizer 110. The LSF vector input to the second vector quantization unit 121 through the line subtracts a LSF predicted by the second predictor 125 through the second subtractor 105 to output a predicted error. The predicted error signal subtraction is calculated as the following equation 4.
                                          r                          2              ,                                                          ⁢              n                        i                    =                                                                      (                                                            f                      n                      i                                        -                                                                  f                        ~                                                                    2                        ,                                                                                                  ⁢                        n                                            i                                                        )                                /                                  β                  2                  i                                            ⁢                                                          ⁢              i                        =            1                          ,        …        ⁢                                  ,        10                            [                  Equation          ⁢                                          ⁢          4                ]            where, ri2,n is a prediction error of an ith element in an nth frame of the LSF vector of the second vector quantizer 121, fin is an ith element in the nth frame of LSF vector,
      f    ~        2    ,                  ⁢    n    iis an ith element in the nth frame of the prediction LSF vector of the second vector quantization unit 121, and βi2 is a prediction coefficient between ri2,n and fin of the second vector quantization unit 121.
The prediction error signal output through the second subtractor 105 is quantized by the second vector quantizer 120. The quantized prediction error signal is input to the second predictor 125 and a second adder 135. The quantized prediction error signal input to the second predictor 125 is calculated as shown in the following equation 5 to predict the next frame and then stored into a memory.
                                                        f              ~                                      2              ,                                                          ⁢                              n                +                1                                      i                    =                                                    α                2                i                            ⁢                                                r                  ^                                                  2                  ,                                                                          ⁢                  n                                i                            ⁢                                                          ⁢              i                        =            1                          ,        …        ⁢                                  ,        10                            [                  Equation          ⁢                                          ⁢          5                ]            wherein, {circumflex over (r)}2,ni is an ith element in an nth frame of the quantized prediction error signal of the second vector quantization unit 121, and αi2 is an prediction coefficient of the ith element of the second vector quantization unit 121.
The signal input to the second adder 135 is added to the predicted signal and the LSF vector quantized by the second quantizer 120 is output to the switch selection unit 140 through the lines. The predicted signal adding process by the second adder 135 is performed as shown in Equation 6.
                                                        f              ^                                      2              ,                                                          ⁢              n                        i                    =                                                                      f                  ~                                                  2                  ,                                                                          ⁢                  n                                i                            +                                                β                  2                  i                                ⁢                                                      r                    ^                                                        2                    ,                                                                                  ⁢                    n                                    i                                ⁢                                                                  ⁢                i                                      =            1                          ,        …        ⁢                                  ,        10                            [                  Equation          ⁢                                          ⁢          6                ]            where, {circumflex over (r)}2,ni is an ith element of a quantized vector of an nth frame of the prediction error signal in the second vector quantizer 120. An LSF vector selection unit 140 calculates a difference between the original LSF vector and the quantized LSF vector output from the respective first and second quantization units 111 and 121, and inputs a switch selection signal selecting a smaller LSF vector into the switch selection unit 145. The switch selection unit 145 selects the quantized LSF having the smaller difference with the original LSF vector, among the quantized LSF vectors by the respective first and second vector quantization units 111 and 121 by using the switch selection signal, and outputs the selected quantized LSF to the lines.
In general, the respective first and second vector quantization units 111 and 121 have the same configuration. However, to more flexibly respond to the correlation between frames of the LSF vector, other predictors 115 and 125 are used. Each of the vector quantizers 110 and 120 has a codebook. Therefore, calculation amount is twice as large as with one quantization unit. In addition, one bit of the switch selection information is transmitted to the decoder to inform the decoder of a selected quantization unit.
In the conventional quantizer arrangement described above, the quantization is performed by using two quantization units in parallel. Thus, the complexity is twice as large as with one quantization unit and one bit is used to represent the selected quantization unit. In addition, when the switching bit is corrupted on the channel, the decoder may select the wrong quantization unit. Therefore, the voice decoding quality may be seriously degraded.
Thus, there is a need for a voice encoding/decoding apparatus and method capable of causing specific quantization/dequantization for a current frame to be performed based on characteristics of the voice synthesized in previous frames to reduce complexity and calculation amount and efficiently performing LSF quantization in a CELP series voice codec.